package com.paypal.android.MEP.b;

import android.content.Context;
import android.graphics.drawable.GradientDrawable;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.TextView;
import com.paypal.android.MEP.a.k;
import com.paypal.android.MEP.h;
import com.paypal.android.MEP.i;
import com.paypal.android.MEP.l;
import com.paypal.android.MEP.m;
import com.paypal.android.a.r;
import com.paypal.android.b.c;
import com.paypal.android.b.d;
import java.math.BigDecimal;
import java.util.ArrayList;

public final class e extends c
  implements View.OnTouchListener
{
  private com.paypal.android.b.g a;
  private boolean b;
  private GradientDrawable g;
  private GradientDrawable h;

  public e(Context paramContext, com.paypal.android.b.n paramn)
  {
    super(paramContext);
    com.paypal.android.MEP.e locale = com.paypal.android.MEP.e.a();
    h localh = locale.c();
    l locall1 = locale.d();
    boolean bool1 = paramn instanceof com.paypal.android.MEP.a.g;
    int i;
    if (((paramn instanceof com.paypal.android.MEP.a.q)) || ((paramn instanceof k)))
    {
      i = 1;
      a(new LinearLayout.LayoutParams(-1, -2), 0);
      a(new LinearLayout.LayoutParams(-1, -2), 1);
      this.g = com.paypal.android.a.f.a(-1, -1510918, -7829368);
      this.h = com.paypal.android.a.f.a(-1, 14209956, -7829368);
      setBackgroundDrawable(this.g);
      setPadding(5, 5, 5, 0);
      a(com.paypal.android.a.g.a(14218, 463));
      b(com.paypal.android.a.g.a(38432, 430));
      setOnTouchListener(this);
      if (locale.A() == 3)
        break label1232;
      if ((localh.j().compareTo(BigDecimal.ZERO) <= 0) && (localh.i().compareTo(BigDecimal.ZERO) <= 0) && (!locale.o()) && (!localh.f()) && (localh.b().size() <= 1))
        break label333;
    }
    label333: for (boolean bool2 = true; ; bool2 = false)
    {
      this.b = bool2;
      if ((((m)localh.b().get(0)).c() == null) || (((m)localh.b().get(0)).c().c() == null))
        break label339;
      for (int k = 0; k < ((m)localh.b().get(0)).c().c().size(); k++)
        if (((com.paypal.android.MEP.j)((m)localh.b().get(0)).c().c().get(k)).f())
          this.b = true;
      i = 0;
      break;
    }
    label339: this.c.setGravity(16);
    ImageView localImageView2;
    label442: label482: label620: TextView localTextView1;
    String str2;
    if (i != 0)
    {
      localImageView2 = com.paypal.android.a.g.a(paramContext, "system-icon-confirmation.png");
      this.c.addView(localImageView2);
      this.a = new com.paypal.android.b.g(paramContext, r.d, r.c, 0.5F, 0.5F);
      if (i == 0)
        break label894;
      if ((!locale.C()) && (locale.l() != 1))
        break label860;
      this.a.a(com.paypal.android.a.j.a("ANDROID_total_paid") + ":");
      this.a.a(-16777216);
      if (!localh.f())
        break label1029;
      this.a.b(com.paypal.android.a.n.a(localh.g().l(), localh.a()));
      this.a.b(-13408768);
      this.a.setPadding(5, 0, 5, 0);
      this.c.addView(this.a);
      this.c.addView(this.e);
      this.e.setVisibility(0);
      if (!this.b)
        break label1226;
      this.d.setOrientation(1);
      View localView2 = new View(paramContext);
      localView2.setLayoutParams(new LinearLayout.LayoutParams(-1, 1));
      localView2.setBackgroundColor(-7829368);
      this.d.addView(localView2);
      if (!localh.f())
        break label1052;
      LinearLayout localLinearLayout2 = f.a(paramContext, localh.g(), localh.a());
      this.d.addView(localLinearLayout2);
      View localView3 = new View(paramContext);
      localView3.setLayoutParams(new LinearLayout.LayoutParams(-1, 1));
      localView3.setBackgroundColor(-7829368);
      this.d.addView(localView3);
      localTextView1 = com.paypal.android.a.q.a(r.c, paramContext);
      localTextView1.setGravity(5);
      if (!localh.f())
        break label1153;
      str2 = com.paypal.android.a.n.a(localh.g().l(), localh.a());
      label701: if (!str2.contains(localh.a()))
        break label1174;
      localTextView1.setText(com.paypal.android.a.j.a("ANDROID_total") + ": " + str2);
    }
    while (true)
    {
      this.d.addView(localTextView1);
      TextView localTextView2 = com.paypal.android.a.q.a(r.f, paramContext);
      localTextView2.setLayoutParams(new LinearLayout.LayoutParams(-1, -2));
      localTextView2.setGravity(5);
      localTextView2.setText(com.paypal.android.a.j.a("ANDROID_shipping_tax_estimated_note"));
      if ((locale.o()) && (bool1))
        this.d.addView(localTextView2);
      return;
      if ((locale.C()) || (locale.l() == 1))
      {
        localImageView2 = com.paypal.android.a.g.a(paramContext, "shopping-list-enabled.png");
        break;
      }
      localImageView2 = com.paypal.android.a.g.a(paramContext, "shopping-cart-enabled.png");
      break;
      label860: this.a.a(com.paypal.android.a.j.a("ANDROID_receipt") + ":");
      break label442;
      label894: if (this.b)
      {
        this.a.a(com.paypal.android.a.j.a("ANDROID_my_total") + ":");
        break label442;
      }
      String str1 = ((m)localh.b().get(0)).f();
      if ((str1 != null) && (str1.length() > 0))
      {
        this.a.a(str1 + ":");
        break label442;
      }
      this.a.a(com.paypal.android.a.j.a("ANDROID_my_total") + ":");
      break label442;
      label1029: this.a.b(com.paypal.android.a.n.a(localh.h(), localh.a()));
      break label482;
      label1052: ArrayList localArrayList = localh.b();
      if (localArrayList.size() == 1)
      {
        LinearLayout localLinearLayout1 = f.a(paramContext, (m)localArrayList.get(0), localh.a());
        this.d.addView(localLinearLayout1);
        break label620;
      }
      for (int j = 0; j < localArrayList.size(); j++)
      {
        f localf = new f(paramContext, (m)localArrayList.get(j), localh.a());
        this.d.addView(localf);
      }
      break label620;
      label1153: str2 = com.paypal.android.a.n.a(localh.h().toString(), localh.a());
      break label701;
      label1174: localTextView1.setText(com.paypal.android.a.j.a("ANDROID_total") + " (" + localh.a() + "): " + str2);
    }
    label1226: setClickable(false);
    return;
    label1232: this.b = true;
    this.c.setGravity(16);
    ImageView localImageView1;
    if (i != 0)
    {
      localImageView1 = com.paypal.android.a.g.a(paramContext, "system-icon-confirmation.png");
      label1259: this.c.addView(localImageView1);
      this.a = new com.paypal.android.b.g(paramContext, r.d, r.c, 0.5F, 0.5F);
      if (i == 0)
        break label1694;
      this.a.a(com.paypal.android.a.j.a("ANDROID_receipt") + ":");
      this.a.b("");
    }
    while (true)
    {
      this.a.a(-16777216);
      this.a.b(-13408768);
      this.c.addView(this.a);
      this.c.addView(this.e);
      this.e.setVisibility(0);
      l locall2 = locale.d();
      if (bool1)
        break;
      this.d.setOrientation(1);
      View localView1 = new View(paramContext);
      localView1.setLayoutParams(new LinearLayout.LayoutParams(-1, 1));
      localView1.setBackgroundColor(-7829368);
      this.d.addView(localView1);
      com.paypal.android.b.g localg1 = new com.paypal.android.b.g(paramContext, r.e, r.f);
      localg1.a(com.paypal.android.a.j.a("ANDROID_name") + ":");
      localg1.b(locall1.a());
      this.d.addView(localg1);
      if ((locall2.b() != null) && (locall2.b().length() > 0))
      {
        com.paypal.android.b.g localg3 = new com.paypal.android.b.g(paramContext, r.e, r.f);
        localg3.a(com.paypal.android.a.j.a("ANDROID_start_date") + ":");
        localg3.b(com.paypal.android.a.j.a(locall2.b(), 2));
        this.d.addView(localg3);
      }
      if ((locall2.c() == null) || (locall2.c().length() <= 0))
        break;
      com.paypal.android.b.g localg2 = new com.paypal.android.b.g(paramContext, r.e, r.f);
      localg2.a(com.paypal.android.a.j.a("ANDROID_end_date") + ":");
      localg2.b(com.paypal.android.a.j.a(locall2.c(), 2));
      this.d.addView(localg2);
      return;
      localImageView1 = com.paypal.android.a.g.a(paramContext, "shopping-list-enabled.png");
      break label1259;
      label1694: this.a.a(com.paypal.android.a.j.a("ANDROID_billing_summary"));
      this.a.b("");
    }
  }

  public final void a(boolean paramBoolean)
  {
    if (paramBoolean)
    {
      setBackgroundDrawable(this.h);
      return;
    }
    setBackgroundDrawable(this.g);
  }

  public final void a(boolean paramBoolean1, boolean paramBoolean2)
  {
    if ((paramBoolean1) && (this.b))
    {
      setFocusable(true);
      setClickable(true);
      this.e.setVisibility(0);
      this.a.a(-16777216);
      this.a.b(-13408768);
    }
    do
    {
      return;
      setFocusable(false);
      setClickable(false);
      this.d.setVisibility(8);
      this.e.setVisibility(8);
    }
    while (!paramBoolean2);
    this.a.a(-7829368);
    this.a.b(-7829368);
  }

  public final boolean onTouch(View paramView, MotionEvent paramMotionEvent)
  {
    if (!isFocusable())
      return false;
    switch (paramMotionEvent.getAction())
    {
    default:
      setBackgroundDrawable(this.g);
      return false;
    case 0:
    }
    setBackgroundDrawable(this.h);
    return false;
  }
}

/* Location:           D:\Studium\Bachelorarbeit\BA Marcus Wobig\BA\BA\Decompiler\PicturePassword APK\Programm\PicturePassword_dex2jar.jar
 * Qualified Name:     com.paypal.android.MEP.b.e
 * JD-Core Version:    0.6.2
 */